/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package boundless.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author hendrikdekock
 */
@Embeddable
public class InvitebyidPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "SENDERID")
    private int senderid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "INVITEID")
    private int inviteid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "LEAGUEID")
    private int leagueid;

    public InvitebyidPK() {
    }

    public InvitebyidPK(int senderid, int inviteid, int leagueid) {
        this.senderid = senderid;
        this.inviteid = inviteid;
        this.leagueid = leagueid;
    }

    public int getSenderid() {
        return senderid;
    }

    public void setSenderid(int senderid) {
        this.senderid = senderid;
    }

    public int getInviteid() {
        return inviteid;
    }

    public void setInviteid(int inviteid) {
        this.inviteid = inviteid;
    }

    public int getLeagueid() {
        return leagueid;
    }

    public void setLeagueid(int leagueid) {
        this.leagueid = leagueid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) senderid;
        hash += (int) inviteid;
        hash += (int) leagueid;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InvitebyidPK)) {
            return false;
        }
        InvitebyidPK other = (InvitebyidPK) object;
        if (this.senderid != other.senderid) {
            return false;
        }
        if (this.inviteid != other.inviteid) {
            return false;
        }
        if (this.leagueid != other.leagueid) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        //return "boundless.entities.InvitebyidPK[ senderid=" + senderid + ", inviteid=" + inviteid + ", leagueid=" + leagueid + " ]";
        return "Invitation for " + inviteid + " to join League " + leagueid;
    }
    
}
